/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fillDB;

import edu.chl.angholt.bookproject.db.AuthorJpaCtrl;
import edu.chl.angholt.bookproject.db.BookJpaCtrl;
import edu.chl.angholt.bookproject.db.Database;
import edu.chl.angholt.bookproject.db.UserJpaCtrl;
import edu.chl.angholt.bookproject.db.entity.Author;
import edu.chl.angholt.bookproject.db.entity.Book;
import java.util.Calendar;

/**
 *
 * @author Maria
 */
public class FillDB {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        BookJpaCtrl bookCtrl = Database.getBookController();
        UserJpaCtrl userCtrl = Database.getUserController();
        AuthorJpaCtrl authorCtrl = Database.getAuthorController();


        Author john = new Author("John", "Sweden", "bi", "www.john.se");
        Author maria = new Author("Maria", "Sweden", "bi", "www.maria.se");
        Author anna = new Author("Anna", "Sweden", "bi", "www.anna.se");
        Author lovisa = new Author("Lovisa", "Sweden", "bi", "www.lovisa.se");
//        authorCtrl.create(john);
//        authorCtrl.create(maria);
//        authorCtrl.create(anna);
//        authorCtrl.create(lovisa);


        bookCtrl.create(new Book(Calendar.getInstance(), "Sy", "Book1", "Swedich", "Publi", john));
        bookCtrl.create(new Book(Calendar.getInstance(), "Sy", "Book2", "Swedich", "Publi", anna));
        bookCtrl.create(new Book(Calendar.getInstance(), "Sy", "Book3", "Swedich", "Publi", maria));
        bookCtrl.create(new Book(Calendar.getInstance(), "Sy", "Book4", "Swedich", "Publi", lovisa));


    }
}
